/*

  gps.h

 */

#ifndef GPS_H
#define GPS_H

typedef struct GPS_POSData    // Position related data as reported by the GPS
{
  float  UTCTime;              // UTC time at fix (format HHMMSS | H = hour, M = minutes, S = Seconds)
  
  float latitude;             // Full latitude float as reported by the GPS (format DDMM.MMM | D = Degrees, M = minutes)
  int   latDeg;               // Latitude degree reported as an int
  float latMin;               // Latitude minutes reported as a float (note no seconds).  
  uchar latSign;              // Whether you are N or S of the equator.
 
  float longitude;            // Full longitude float as reported by the GPS (format DDMM.MMM | D = Degrees, M = minutes)
  int   longDeg;              // Longitude degree reported as an int
  float longMin;              // Longitude minutes reported as a float (note no seconds).
  uchar longSign;             // Whether you are E or W of the prine merdian.

  int   fix;                  // Tells you if you have a fix.  0 = No, 1 = Sat fix, 2 = Diff Sat fix (Best, I think).
  int   numSats;              // Tells you how many sats were used to get position.  3 min; the more the better.

}GPS_POSData;

typedef struct GPS_NAVData    // Navigation data as reported by the GPS unit.
{
  bool  isValid;              // Tells us if the data is valid
  float crossTrackErr;        // Distance from tracking line
  uchar steeringDir;          // Direction to turn to return to tracking line
  float rangeToDest;          // Distance from destination
  float bearingToDest;        // The bearing of the destination
  float velocityTowardsDest;  // The vehicles velocity towards the destination
  bool  atDest;               // Tells us when we are in the arrival circle (ie. at destination)
}GPS_NAVData;


void GPS_TestProg( void *p);              // Stupid test program to make sure its working.
int GPS_GetPOSData( GPS_POSData *pData ); // Reads a full NMEA string, and fills the values in the struct
int GPS_GetNAVData( GPS_NAVData *pData ); // Reads a full NMEA string, and fills the values in the struct

#endif
